<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function getrandom(m,n){
          let tmp=Math.max(m,n)
            n=Math.min(m,n)
            m=tmp
        return math= Math.floor(Math.random()*(m-n)+n) 
        }
       //console.log(getrandom(1,10)) 
        function getcolor(){
            let r= getrandom(0,251).toString(16)
            let g= getrandom(0,251).toString(16)
            let b= getrandom(0,251).toString(16)
            //console.log(`#${r}${g}${b}`)
            let stu=`#${r}${g}${b}`
            console.log(stu)
            if(stu.length==4||stu.length==7){
                console.log(stu)
            }
        }
        getcolor();
    </script>
    
</body>
</html>